<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="HtmlBody.ascx.cs" Inherits="Website.Views.PageTitle.HtmlBody" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Web.Mvc" %>
<%@ Import Namespace="System.Web.Routing" %>
<%@ Import Namespace="Website.Models" %>
<h1 id="title"><%=HttpUtility.HtmlEncode(this.ViewData.Model.Title) %></h1>
<% if (!WikiPage.IsValidTitle(this.ViewData.Model.Title)) { %>
<p>Sorry, this is not a valid wikiword.</p>
<%=String.Concat("<!--", new String('.', 200), " -->")%>
<% } else if (!this.ViewData.Model.LastModified.HasValue || this.ViewData.Model.Removed.HasValue) { %>
<p>This wiki does not have an article with this exact name.</p>
<%=Html.RenderUserControl("~/Views/PageTitle/HtmlForm.ascx", this.ViewData.Model) %>
<% } else { %>
<p id="body"><%=this.ViewData.Model.ToHtml() %></p>
<p id="buttons">
    <a href="#" rel="nofollow" onclick="displayEdit('<%=Url.RouteUrl("page/{title}", new RouteValueDictionary(new { title = this.ViewData.Model.Title })) %>')">Edit</a>
    &nbsp;|&nbsp;
    <a href="#" rel="nofollow" onclick="deleteResource('<%=Url.RouteUrl("page/{title}", new RouteValueDictionary(new { title = this.ViewData.Model.Title })) %>')">Delete</a>
</p>
<% } %>